<div style="clear:both;height:5px;"></div>
<script type="text/javascript" src="/js/scriptlogin.js" language="javascript" ></script>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
		if(!isset($login) || $login =="0")
		{?>
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
		    <div class="head">
		            <h4><?php echo $title;?></h4>
		        </div>
			<div class="middle_box" style="height:auto;">
				<form id="loginForm" name="loginForm" method="post" action="" onsubmit="return validateLogInForm(<?php echo "'".$warningUser."','".$warningPass."'";?>)">
								<div style="float:left;width:93%;margin-left:5%;">
									<div style="float:left;font-size:12px;margin-top:10px;">
										<div style="line-height:22px;text-align:right;width:70px;float:left;"><?php echo $textUser;?></div>
										<div style="float:left;margin-left:5px;"><input type="text" id="userID" name="userID" maxlength="45" style="font-size:13px; width:100px;"></div>
									</div>
									<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertID"></div></div>
									<div style="clear:both;float:left;font-size:12px;margin-top:10px;">
										<div style="line-height:22px;text-align:right;width:70px;float:left;"><?php echo $textPass;?></div>
										<div style="float:left;margin-left:5px;"><input type="password" id="userPass" name="userPass" maxlength="100" style="font-size:13px;width:100px;"></div>	
									</div>
									<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertPass"></div></div>
								</div>
								<div style="clear:both;"></div>
								<div style="float:right;margin-right:15px;">
									<button type="submit" class="form-button-alt"><span><?php echo $textLogin;?> </span></button>
								</div>
								<?php if(isset($errorMessage) && $errorMessage != ''){?>
								<br />
								<div style="clear:both;text-align:center;font-size:12px;color:red"><?php echo $errorMessage;?></div>
								<?php }?>
								<div style="clear:both;margin-left:6px;border-bottom: 1px dotted #000000;width:190px;height:2px;">
									<a href="http://cms/register/email" style="margin-top:5px; margin-left:5px; font-size:12px; float:left;"><?php echo $textForget;?></a>
									<a href="http://cms/register/index" style="margin-top:5px; margin-right:5px; font-size:12px; float:right;"><?php echo $textRegister;?></a>
								</div>
							</form>
							<div style="clear:both"></div>
		    </div>
			<div class="bottom_box"><span></span></div>
		</div>
		<?php 
		}
		else 
		{?>
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
		    <div class="head">
		            <h4 style="width:70%;float:left"><?php echo $title;?></h4>
		            <?php if(isset($permission) && $permission=="true") {?>
						<!-- Tạo cây bút chì cho click and change -->
							<div style="float: right; ">
							<ul class="gallery clearfix">
								<a href="/login/clickchange?iframe=true&width=350&height=220" rel="prettyPhoto[iframe]">
									<img src="/images/Pencil.png" style="width:20px ; height:20px; " title="<?php echo $textEdit;?>"></img>
								</a>
							</ul>
							</div>
						<!-- End - Tạo cây bút chì cho click and change -->
						<?php }?>
		    </div>
			<div class="middle_box" style="height:60px;">
								<div style="float:left;width:93%;margin-left:5%;">
								<div style="float:left;font-size:12px;margin-top:10px;">
									<div style="line-height:22px;text-align:left;width:65px;float:left;"><?php echo $textWelcome;?> </div>
									<a href="/account" style="line-height:22px;text-align:left;width:70px;float:left;"><?php echo $user_name;?></a>
								</div>
								
								</div>
								<div style="clear:both;"></div>
								
								<div style="clear:both;margin-left:6px;border-bottom: 1px dotted #000000;width:190px;height:2px;">
								<a href="/login/login/logout" style="margin-top:5px; margin-left:5px; font-size:12px; float:left;"><?php echo $textLogout;?></a>
								</div>
		    </div>
		</div>
		<div class="bottom_box"><span></span></div>
		<?php
		}
	}
	else 
	{
		if($_SESSION['config_template']=='layoutmain_web2')
		{ ?>
		<link rel="stylesheet" type="text/css" href="/css/web2/sidebar2.css" media="all">
		<?php if(!isset($login) || $login =="0") {?>
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
		    <div class="head">
		            <h4><?php echo $title;?></h4>
		        </div>
			<div class="middle_box" style="height:auto;">
				<form id="loginForm" name="loginForm" method="post" action="" onsubmit="return validateLogInForm(<?php echo "'".$warningUser."','".$warningPass."'";?>)">
								<div style="float:left;width:93%;margin-left:5%;">
									<div style="float:left;font-size:12px;margin-top:10px;">
										<div style="line-height:22px;text-align:right;width:70px;float:left;"><?php echo $textUser;?></div>
										<div style="float:left;margin-left:5px;"><input type="text" id="userID" name="userID" maxlength="45" style="font-size:13px; width:120px;"></div>
									</div>
									<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertID"></div></div>
									<div style="clear:both;float:left;font-size:12px;margin-top:10px;">
										<div style="line-height:22px;text-align:right;width:70px;float:left;"><?php echo $textPass;?></div>
										<div style="float:left;margin-left:5px;"><input type="password" id="userPass" name="userPass" maxlength="100" style="font-size:13px; width:120px;"></div>	
									</div>
									<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertPass"></div></div>
								</div>
								<div style="clear:both;"></div>
								<div style="float:right;margin-right:30px;">
									<button type="submit" class="form-button"><span><?php echo $textLogin;?> </span></button>
								</div>
								<?php if(isset($errorMessage) && $errorMessage != ''){?>
								<br />
								<div style="clear:both;text-align:center;font-size:12px;color:red"><?php echo $errorMessage;?></div>
								<?php }?>
								<div style="clear:both;margin-left:6%;border-bottom: 1px dotted #000000;width:200px;height:5px;">
									<a href="http://cms/register/email" style="margin-top:10px; margin-left:5px; font-size:12px; float:left;"><?php echo $textForget;?></a>
									<a href="http://cms/register/index" style="margin-top:10px; margin-right:5px; font-size:12px; float:right;"><?php echo $textRegister;?></a>
								</div>
							</form>
							<div style="clear:both"></div>
		    </div>
		</div>
		<div class="bottom_box"><span></span></div>
		<?php 
		}
		else 
		{?>
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
		    <div class="head">
		            <h4 ><?php echo $title;?>
		            <?php if(isset($permission) && $permission=="true") {?>
						<!-- Tạo cây bút chì cho click and change -->
							<div style="float: right; ">
							<ul class="gallery clearfix">
								<a href="/login/clickchange?iframe=true&width=350&height=220" rel="prettyPhoto[iframe]">
									<img src="/images/Pencil.png" style="width:20px ; height:20px; " title="<?php echo $textEdit;?>"></img>
								</a>
							</ul>
							</div>
						<!-- End - Tạo cây bút chì cho click and change -->
						<?php }?>
					</h4>
		    </div>
			<div class="middle_box" style="height:60px;">
								<div style="float:left;width:93%;margin-left:5%;">
								<div style="float:left;font-size:12px;margin-top:10px;">
									<div style="line-height:22px;text-align:left;width:65px;float:left;"><?php echo $textWelcome;?> </div>
									<a href="/account" style="line-height:22px;text-align:left;width:70px;float:left;"><?php echo $user_name;?></a>
								</div>
								
								</div>
								<div style="clear:both;"></div>
								
								<div style="clear:both;margin-left:6px;border-bottom: 1px dotted #000000;width:210px;height:2px;">
								<a href="/login/login/logout" style="margin-top:5px; margin-left:5px; font-size:12px; float:left;"><?php echo $textLogout;?></a>
								</div>
		    </div>
		</div>
		<div class="bottom_box"><span></span></div>
		<?php } ?>
		<!-- end web 2 -->
		
		<?php } else  {?>
					<div id="login">
					<?php if(!isset($login) || $login =="0")
					{?>
					<div class="c_navigator">
						<p class="navi_content"><?php echo $title;?></p>
					</div> <!--end c_navigator-->
					<form id="loginForm" name="loginForm" method="post" action="" onsubmit="return validateLogInForm(<?php echo "'".$warningUser."','".$warningPass."'";?>)">
						<div style="float:left;width:90%;margin-left:9%;">
						<div style="float:left;font-size:13px;margin-top:5px;">
							<div style="line-height:22px;text-align:right;width:80px;float:left;"><?php echo $textUser;?></div>
							<div style="float:left;margin-left:5px;"><input type="text" id="userID" name="userID" maxlength="45" style="font-size:13px; width:120px;"></input></div>
						</div>
						<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertID"></div></div>
						<div style="clear:both;float:left;font-size:13px;margin-top:5px;">
							<div style="line-height:22px;text-align:right;width:80px;float:left;"><?php echo $textPass;?></div>
							<div style="float:left;margin-left:5px;"><input type="password" id="userPass" name="userPass" maxlength="100" style="font-size:13px;width:120px;"></input></div>	
						</div>
						<div style="clear:both;float:right;font-size:12px;margin-top:5px;margin-right:20px;"><div id="alertPass"></div></div>
						</div>
						<div style="clear:both;"></div>
						<div style="float:right;margin-right:20px;" ><input style="color:#050;font: bold 84% 'trebuchet ms',helvetica,sans-serif;"type="submit" name="btnlogin" value="<?php echo $textLogin;?>" style="font-size:13px; text-align:center; padding:5px; height:50px;" ></input></div>
						<?php if(isset($errorMessage) && $errorMessage != ''){?>
						<br />
						<div style="clear:both;text-align:center;font-size:12px;color:red"><?php echo $errorMessage;?></div>
						<?php }?>
						<div style="clear:both;margin-left:30px;border-bottom: 1px dotted #000000;width:200px;height:5px;"></div>
						<a href="/register/email" style="margin-top:5px; margin-left:50px;; font-size:13px; float:left;"><?php echo $textForget;?></a>
						<a href="/register/index" style="margin-top:5px; margin-left:30px;; font-size:13px; float:left;"><?php echo $textRegister;?></a>
					</form>
					<?php } else {?>
						<div class="c_navigator">
						<p class="navi_content"><?php echo $title;?></p>
						
						<?php if(isset($permission) && $permission=="true") {?>
						<!-- Tạo cây bút chì cho click and change -->
							<div style="float: right; margin-right:5px">
							<ul class="gallery clearfix">
								<a href="/login/clickchange?iframe=true&width=350&height=220" rel="prettyPhoto[iframe]">
									<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:10px;" title="<?php echo $textEdit;?>"></img>
								</a>
							</ul>
							</div>
						<!-- End - Tạo cây bút chì cho click and change -->
						<?php }?>
						
						</div> <!--end c_navigator-->
						<div style="margin-top:5px; margin-left:40px;; font-size:15px; float:left;">
						<p style="color: black;"><?php echo $textWelcome;?> <a href="/account"><?php echo $user_name;?></a></p>
						<div style="clear:both;border-bottom: 1px dotted #000000;width:190px;height:5px;"></div>
						<a href="/login/login/logout" style="margin-top:6px; margin-left:1%; line-height:140%"><?php echo $textLogout;?></a>
						</div>
					<?php } ?>
				</div><!--end login-->
		<?php }
	}
}?>
<div style="clear:both;"></div>